(function () {
  'use strict';

  angular
    .module('client')
    .factory('navbarService', navbarService);

  navbarService.$inject = ['$q', '$resource', 'NAV_API'];
  function navbarService($q, $resource, NAV_API) {
    var service = {
      releaseDevice: releaseDevice
    };
    return service;

    function releaseDevice(deviceID) {
      var q = $q.defer();
      $resource(NAV_API.releaseDevice, {deviceID: deviceID})
       .delete(
       {},
       function (resp) {
       q.resolve(resp);
       },
       function (resp) {
       q.resolve(resp)
       });
      return q.promise;
    }
  }
}());
